﻿using System;
using System.Windows.Forms;
using Deanery.Controller.Service;

namespace Deanery.View
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// This method open DirectoryForm for work with directories
        /// </summary>
        /// <param name="tableName">table name for data source</param>
        private void OpenForm(string tableName)
        {
            Form frm = new DirectoryForm(tableName);
            frm.MdiParent = this;
            frm.Show();
        }

        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var imp = new StudentImportForm();
            imp.Show();
        }

        /// <summary>
        /// These methods cause OpenForm and transfers appropriate table name
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ectsEvaluationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("ECTS_Ocinka");
        }


        private void facultyToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            OpenForm("Faculty");
        }

        private void semesterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Semester");
        }

        private void cityTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_City");
        }

        private void contactsTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Contacts");
        }

        private void documentsTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Documents");
        }

        private void ordersTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Orders");
        }

        private void privilegeTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Privilege");
        }

        private void streetTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Street");
        }

        private void testTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Test");
        }

        private void statusToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Status");
        }

        private void educationTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Education");
        }

        private void paymentTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Type_Payment");
        }
        
        private void sexToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Sex");
        }

        private void regionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Region");
        }

        private void privilegeGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Privilege_Group");
        }

        private void napryamToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Napryam");
        }

        private void qualificationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Qualification");
        }

        private void subjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenForm("Subject");
        }

        private void createNavchalnuyPlanToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var crNavPlan = new CreateNavchalnuyPlanForm();
            crNavPlan.Show();
        }
    }
}
